/*     */ package com.zimbra.cs.account;
/*     */ 
/*     */ import com.zimbra.common.account.ZAttrProvisioning.DomainStatus;
/*     */ import com.zimbra.common.account.ZAttrProvisioning.DomainType;
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.common.util.Log;
/*     */ import com.zimbra.common.util.StringUtil;
/*     */ import com.zimbra.common.util.ZimbraLog;
/*     */ import java.util.HashMap;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class Domain
/*     */   extends ZAttrDomain
/*     */ {
/*     */   private String mUnicodeName;
/*  44 */   private Map<String, Object> mAccountDefaults = new HashMap();
/*     */   
/*     */   public Domain(String name, String id, Map<String, Object> attrs, Map<String, Object> defaults, Provisioning prov) {
/*  47 */     super(name, id, attrs, defaults, prov);
/*  48 */     if (name == null) {
/*  49 */       this.mUnicodeName = name;
/*     */     } else
/*  51 */       this.mUnicodeName = IDNUtil.toUnicodeDomainName(name);
/*  52 */     if (attrs != null) {
/*  53 */       resetData();
/*     */     }
/*     */   }
/*     */   
/*     */   public Entry.EntryType getEntryType() {
/*  58 */     return Entry.EntryType.DOMAIN;
/*     */   }
/*     */   
/*     */   public void modify(Map<String, Object> attrs) throws ServiceException {
/*  62 */     getProvisioning().modifyAttrs(this, attrs);
/*     */   }
/*     */   
/*     */   public void deleteDomain(String zimbraId) throws ServiceException {
/*  66 */     getProvisioning().deleteDomain(getId());
/*     */   }
/*     */   
/*     */   public List getAllAccounts() throws ServiceException {
/*  70 */     return getProvisioning().getAllAccounts(this);
/*     */   }
/*     */   
/*     */   public void getAllAccounts(NamedEntry.Visitor visitor) throws ServiceException {
/*  74 */     getProvisioning().getAllAccounts(this, visitor);
/*     */   }
/*     */   
/*     */   public void getAllAccounts(Server s, NamedEntry.Visitor visitor) throws ServiceException {
/*  78 */     getProvisioning().getAllAccounts(this, s, visitor);
/*     */   }
/*     */   
/*     */   public List getAllCalendarResources() throws ServiceException {
/*  82 */     return getProvisioning().getAllCalendarResources(this);
/*     */   }
/*     */   
/*     */   public void getAllCalendarResources(NamedEntry.Visitor visitor) throws ServiceException {
/*  86 */     getProvisioning().getAllCalendarResources(this, visitor);
/*     */   }
/*     */   
/*     */   public void getAllCalendarResources(Server s, NamedEntry.Visitor visitor) throws ServiceException {
/*  90 */     getProvisioning().getAllCalendarResources(this, s, visitor);
/*     */   }
/*     */   
/*     */   public List getAllDistributionLists() throws ServiceException {
/*  94 */     return getProvisioning().getAllDistributionLists(this);
/*     */   }
/*     */   
/*     */   public String getGalSearchBase(String searchBaseSpec) throws ServiceException {
/*  98 */     throw ServiceException.FAILURE("unsupported", null);
/*     */   }
/*     */   
/*     */   protected void resetData()
/*     */   {
/* 103 */     super.resetData();
/*     */     try {
/* 105 */       getDefaults(AttributeFlag.accountCosDomainInherited, this.mAccountDefaults);
/*     */     }
/*     */     catch (ServiceException e) {}
/*     */   }
/*     */   
/*     */   public Map<String, Object> getAccountDefaults()
/*     */   {
/* 112 */     return this.mAccountDefaults;
/*     */   }
/*     */   
/*     */   public String getUnicodeName() {
/* 116 */     return this.mUnicodeName;
/*     */   }
/*     */   
/*     */   public boolean isSuspended() {
/* 120 */     ZAttrProvisioning.DomainStatus status = getDomainStatus();
/* 121 */     boolean suspended = (status != null) && (status.isSuspended());
/*     */     
/* 123 */     if (suspended)
/* 124 */       ZimbraLog.account.warn("domain " + this.mName + " is " + "suspended");
/* 125 */     return suspended;
/*     */   }
/*     */   
/*     */   public boolean isShutdown() {
/* 129 */     ZAttrProvisioning.DomainStatus status = getDomainStatus();
/* 130 */     boolean shutdown = (status != null) && (status.isShutdown());
/*     */     
/* 132 */     if (shutdown)
/* 133 */       ZimbraLog.account.warn("domain " + this.mName + " is " + "shutdown");
/* 134 */     return shutdown;
/*     */   }
/*     */   
/*     */   public boolean beingRenamed() {
/* 138 */     String renameInfo = getAttr("zimbraDomainRenameInfo");
/* 139 */     return !StringUtil.isNullOrEmpty(renameInfo);
/*     */   }
/*     */   
/*     */   public boolean isLocal() {
/* 143 */     ZAttrProvisioning.DomainType domainType = getDomainType();
/* 144 */     return ZAttrProvisioning.DomainType.local == domainType;
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/Domain.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */